home *** CD-ROM | disk | FTP | other *** search
- import java.awt.Graphics;
- import java.net.MalformedURLException;
- import java.net.URL;
-
- class HrefArea extends ImageMapArea {
- URL anchor;
-
- public void handleArg(String arg) {
- try {
- this.anchor = new URL(super.parent.getDocumentBase(), arg);
- } catch (MalformedURLException var2) {
- this.anchor = null;
- }
- }
-
- public void highlight(Graphics g, boolean on) {
- super.highlight(g, on);
- ((ImageMapArea)this).showStatus(on && this.anchor != null ? "Go To " + this.anchor.toExternalForm() : null);
- }
-
- public void lift(int x, int y) {
- if (((ImageMapArea)this).inside(x, y) && this.anchor != null) {
- ((ImageMapArea)this).showDocument(this.anchor);
- }
-
- }
-
- public HrefArea() {
- }
- }
-